package Game;

import java.awt.Font;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.UnicodeFont;
import org.newdawn.slick.font.effects.ColorEffect;

/**
 * Creates a message bar at the top of the screen 
 * @author Johan
 *
 */
public class MessageBar {
	
	private UnicodeFont bar;
	private String message = "";
	
	
	
	@SuppressWarnings("unchecked")
	public MessageBar() throws SlickException
	{
		bar = new UnicodeFont(new Font("SansSerif", Font.BOLD, 24));
		bar.addAsciiGlyphs();   
		bar.addGlyphs(400, 600); 
		bar.getEffects().add(new ColorEffect(java.awt.Color.WHITE)); 
		bar.loadGlyphs();
	}
	/**
	 * Update the message string
	 * @param str the string to be showed
	 */
	public void update(String str)
	{
		message = str;
	}
	
	/**
	 * Draws the messages at the top of the screen
	 */
	public void draw()
	{
		bar.drawString(150, 0, message);	
	}
}
